<?php
namespace pinduoduo\Request;

use pinduoduo\AbstractInterface\Request;

class PddDdkWeappQrcodeUrlGenRequest extends Request
{

    /**
     * 多多客生成单品推广小程序二维码url
     * @var string
     */
    private $type = 'pdd.ddk.weapp.qrcode.url.gen';

    /**
     * 多多礼金ID
     * @var
     */
    private $cashGiftId;

    /**
     * 自定义参数，为链接打上自定义标签；自定义参数最长限制64个字节；格式为： {"uid":"11111","sid":"22222"} ，其中 uid 用户唯一标识，可自行加密后传入，每个用户仅且对应一个标识，必填； sid 上下文信息标识，例如sessionId等，非必填。该json字符串中也可以加入其他自定义的key
     * @var
     */
    private $customParameters;

    /**
     * 是否生成店铺收藏券推广链接
     * @var
     */
    private $generateMallCollectCoupon;

    /**
     * 商品goodsSign列表，支持通过goodsSign查询商品。goodsSign是加密后的goodsId, goodsId已下线，请使用goodsSign来替代。使用说明：https://jinbao.pinduoduo.com/qa-system?questionId=252
     * @var
     */
    private $goodsSignList;

    /**
     * 推广位ID
     * @var
     */
    private $pid;

    /**
     * 招商多多客ID
     * @var
     */
    private $zsduoId;

    public function setType($type)
    {
        $this->type = $type;
    }

    public function getType()
    {
        return $this->type;
    }

    public function setCashGiftId($cashGiftId)
    {
        $this->cashGiftId = $cashGiftId;
    }

    public function getCashGiftId()
    {
        return $this->cashGiftId;
    }

    public function setCustomParameters($customParameters)
    {
        $this->customParameters = $customParameters;
    }

    public function getCustomParameters()
    {
        return $this->customParameters;
    }

    public function setGenerateMallCollectCoupon($generateMallCollectCoupon)
    {
        $this->generateMallCollectCoupon = $generateMallCollectCoupon;
    }

    public function getGenerateMallCollectCoupon()
    {
        return $this->generateMallCollectCoupon;
    }

    public function setGoodsSignList($goodsSignList)
    {
        $this->goodsSignList = $goodsSignList;
    }

    public function getGoodsSignList()
    {
        return $this->goodsSignList;
    }

    public function setPid($pid)
    {
        $this->pid = $pid;
    }

    public function getPid()
    {
        return $this->pid;
    }

    public function setZsduoId($zsduoId)
    {
        $this->zsduoId = $zsduoId;
    }

    public function getZsduoId()
    {
        return $this->zsduoId;
    }

    public function getParams()
    {
        $params = [
            'type'                         => $this->type,
            'cash_gift_id'                 => $this->cashGiftId,
            'custom_parameters'            => $this->customParameters,
            'generate_mall_collect_coupon' => $this->generateMallCollectCoupon,
            'goods_sign_list'              => $this->goodsSignList,
            'p_id'                         => $this->pid,
            'zs_duo_id'                    => $this->zsduoId,
        ];
        return array_filter($params);
    }
}
